package com.edu.publisher.util;

import java.util.Date;

import org.apache.commons.lang3.time.DateFormatUtils;

/**
 * @author zcx
 * @create 2022-10-19 19:59
 */
public class DateFormatUtil {
    public static Integer now() {
        String yyyyMMdd = DateFormatUtils.format(new Date(), "yyyyMMdd");
        return Integer.valueOf(yyyyMMdd);
    }

    public static Integer getDefaultDate(Integer date) {
        if (date == 0) {
            return now();
        }
        return date;
    }
}
